//
//  LGIndicatorView.m
//  UniverseProject
//
//  Created by king on 2018/12/10.
//  Copyright © 2018年 Cloud2209. All rights reserved.
//


#import "LGIndicatorView.h"

@implementation LGIndicatorView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = LGCOLOR(@"e1e1e1");
        UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyleGray)];
        //设置小菊花的frame
        activityIndicator.frame= CGRectMake(0, 0, frame.size.width, frame.size.height);
        //设置小菊花颜色
        activityIndicator.color = [UIColor whiteColor];
        //设置背景颜色
        activityIndicator.backgroundColor = [UIColor clearColor];
        //刚进入这个界面会显示控件，并且停止旋转也会显示，只是没有在转动而已，没有设置或者设置为YES的时候，刚进入页面不会显示
        activityIndicator.hidesWhenStopped = NO;
        [self addSubview:activityIndicator];
        [activityIndicator startAnimating];
        self.activityIndicator = activityIndicator;
    }
    return self;
}

@end
